package com.person.controller;

import com.person.common.UserConstant;
import com.person.model.dto.DepartmentDto;
import com.person.model.entity.Result;
import com.person.service.BasicSettingsService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/basic_settings")
public class BasicSettingsController {
    @Resource
    private BasicSettingsService basicSettingsService;

    @GetMapping("/get/{userId}")
    public Result getBasicSettingsByUserId(@PathVariable int userId) {
        return Result.success(basicSettingsService.getBasicSettingsByUserId(userId));
    }

    @PostMapping("/update")
    public Result updateBasicSetting(@RequestBody DepartmentDto departmentDto) {
        basicSettingsService.updateBasicSetting(departmentDto);
        return Result.success();
    }
}
